---
title: Charmhub | Tempo HA docs - How to enable service graphs
description: In Grafana Tempo, a service graph is a visual representation of the interrelationships
  between various services. Service graphs help you to understand...
url: https://charmhub.io/topics/charmed-tempo-ha/enable service graphs
---

# Tempo HA docs - How to enable service graphs

In [Grafana Tempo](https://grafana.com/docs/tempo/latest/), a service graph is a visual representation of the interrelationships between various services. Service graphs help you to understand the structure of a distributed system, and the connections and dependencies between its components.

See more: [Service graphs](https://grafana.com/docs/tempo/latest/metrics-generator/service_graphs/)

Service graphs are generated in [charmed tempo HA](https://charmhub.io/topics/charmed-tempo-ha) and pushed to a metrics storage ([charmed prometheus](https://charmhub.io/prometheus-k8s) or [charmed mimir HA](https://charmhub.io/mimir-coordinator-k8s)). Then, they can be represented in [charmed grafana](https://charmhub.io/grafana-k8s) as a graph. So, you need the following integrations to fully use service graphs:

* `send-remote-write`
* `grafana-source`
* `receive-datasource`

## [Deploy Tempo HA](https://charmhub.io/topics/charmed-tempo-ha/enable service graphs#p-34975-deploy-tempo-ha)

Check [this guide](https://charmhub.io/topics/charmed-tempo-ha/Deploy charmed tempo HA + COS-Lite) to deploy Tempo HA.

If you intend to deploy charmed Tempo HA in its distributed mode, make sure to deploy a dedicated worker with a `metrics-generator` role using the config option `role-metrics-generator=true`.

By default, deploying charmed Tempo HA in its monolithic mode with role `all`, will have `metrics-generator` enabled.

## [Integrate over `send-remote-write`](https://charmhub.io/topics/charmed-tempo-ha/enable service graphs#p-34975-integrate-over-send-remote-write)

The way service graphs work is that the `metrics-generator`, a Tempo component that derives metrics from ingested traces, processes traces and generates service graphs in the form of Prometheus metrics and pushes them to `prometheus`/`mimir` remote write endpoints.

See more: [How to enable trace metrics](https://charmhub.io/topics/charmed-tempo-ha/trace-metrics-enable)

We’ll be using [charmed prometheus](https://charmhub.io/prometheus-k8s) as the metrics backend, but [charmed mimir HA](https://charmhub.io/mimir-coordinator-k8s) can be used interchangeably as well.

```
juju deploy prometheus-k8s prometheus --channel edge --trust
juju integrate tempo:send-remote-write prometheus
```

## [Integrate over `grafana-source`](https://charmhub.io/topics/charmed-tempo-ha/enable service graphs#p-34975-integrate-over-grafana-source)

For service graphs to be represented in Grafana, we need to configure `tempo` and `prometheus` as datasources in the **same** grafana instance.

```
juju deploy grafana-k8s grafana --channel=edge --trust
juju integrate tempo:grafana-source grafana
juju integrate prometheus:grafana-source grafana
```

## [Integrate over `receive-datasource`](https://charmhub.io/topics/charmed-tempo-ha/enable service graphs#p-34975-integrate-over-receive-datasource)

What is left is to configure Tempo’s datasource to link to Prometheus’s datasource and that can be achieved by exchanging datasource UIDs using the `grafana_datasource_exchange` interface.

```
juju integrate tempo:receive-datasource prometheus:send-datasource
```

See more:  [`grafana_datasource_exchange`](https://charmhub.io/topics/charmed-tempo-ha/correlating-traces)

## [View service graphs in Grafana](https://charmhub.io/topics/charmed-tempo-ha/enable service graphs#p-34975-view-service-graphs-in-grafana)

Open Grafana web UI from your local web browser and login using the [admin password](https://juju.is/docs/sdk/observe-your-charm-with-cos-lite#heading--log-in-to-grafana).

Then, `Toggle Menu → Explore → Choose your Tempo datasource → Service Graph → Run query`

This should result in a graph similar to the one below:

Service graphs work by inspecting traces and looking for spans with parent-children relationship that represent a request. So, the nodes and edges that would come up in the graph depend on the **workload traces** generated by your charmed applications.

Nodes → represent the charmed applications emitting workload spans.

Edges → represent a workload request flow from charmed application A to charmed application B given that their workloads generate spans using the same tracing protocol (e.g: OpenTelemetry protocol).

---

*Last updated 1 year, 10 months ago.*

[Help improve this document in the forum](https://discourse.charmhub.io/t/tempo-ha-docs-how-to-enable-service-graphs/16125).
